-
Notifications
You must be signed in to change notification settings - Fork 227
Implement P3149R11 and P3815R1 #1713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
db2f61a to
9327406
Compare
|
/ok to test fd9d04b |
fd9d04b to
707aed3
Compare
|
The latest push includes an implementation of I have also tried to address the build failures on the previous iteration, but I don't have a local test environment for the failing build types so I haven't tested the fixes locally, other than to confirm that they still build with my local Clang (i.e. |
707aed3 to
66f394c
Compare
|
Rebased on #1717. |
96d4661 to
f786c00
Compare
|
/ok to test f786c00 |
67262ee to
97d79ee
Compare
|
/ok to test 97d79ee |
97d79ee to
95d10a7
Compare
|
I managed to get GCC 12 installed on my Mac and it repro'd the ICE and the build failure in |
52e1755 to
521d849
Compare
|
|
521d849 to
cc867f4
Compare
|
/ok to test cc867f4 |
a1dd153 to
9263dab
Compare
|
I think I've fixed the build breaks in old gcc, nvc++, and MSVC. Getting a repro of the gcc 11 builds was quite a pain—I can't figure out how to get gcc 11 to run properly on macOS Tahoe so I had to use I've updated |
9263dab to
254887d
Compare
|
Pull the guts of |
254887d to
f78a329
Compare
|
Do some template hoisting and renaming, and replace a single |
f78a329 to
e6db1ed
Compare
|
|
/ok to test a7c40ee |
|
/ok to test 3c160e1 |
3c160e1 to
c5ee582
Compare
|
/ok to test c5ee582 |
c5ee582 to
2ac3fb0
Compare
|
I just force-pushed after rebasing on |
2ac3fb0 to
ed8e376
Compare
|
I've re-jiggered the implementation of stop request handling in |
ericniebler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is looking amazing. minor comments only. lmk if you want a hand with merge conflicts.
| __associate_data(__associate_data&& __other) | ||
| noexcept(__nothrow_move_constructible<__wrap_sender_t>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move operations should all be noexcept unconditionally. you can then static_assert that __nothrow_move_constructible<__wrap_sender_t> is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I write just(std::list<int>{})? I believe that, at least in some STLs, std::list doesn't have a no-throw move constructor….
| } | ||
| }; | ||
|
|
||
| using __sender_ref = std::unique_ptr<__wrap_sender_t, __deleter>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a unique_ptr for this seems like overkill. my preference would be to use the __scope_guard in __detail/__scope.hpp instead. something like:
__scope_guard __g{std::destroy_at<_Sender>, &__sndr};There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been written into the spec; I think it's required unless you propose we change the wording.
| void __do_consume(auto& __rcvr) noexcept { | ||
| using __variant_t = decltype(this->__result_); | ||
|
|
||
| __variant_t::visit( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| __variant_t::visit( | |
| __visit( |
| return __apply( | ||
| [&__rcvr](__ignore, auto&& token, __ignore) noexcept { | ||
| return __make_token_fn{}( | ||
| static_cast<decltype(token)>(token), get_stop_token(STDEXEC::get_env(__rcvr))); | ||
| }, | ||
| static_cast<_Self&&>(__self)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this can now be (untested):
auto &[__tag, __token, __child] = __self;
return __make_token_fn{}(__forward_like<_Self>(__token),
get_stop_token(STDEXEC::get_env(__rcvr)));8b988cb to
a0be249
Compare
ispeters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied much of the suggested feedback and left a few questions.
Still to do:
- uglify all the identifiers
- convert virtual functions to stored function pointers
- clean up the implementation of
spawn_future - address any unaddressed comments
| } | ||
| }; | ||
|
|
||
| using __sender_ref = std::unique_ptr<__wrap_sender_t, __deleter>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been written into the spec; I think it's required unless you propose we change the wording.
| __associate_data(__associate_data&& __other) | ||
| noexcept(__nothrow_move_constructible<__wrap_sender_t>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I write just(std::list<int>{})? I believe that, at least in some STLs, std::list doesn't have a no-throw move constructor….
|
|
||
| __spawn_state_base(__spawn_state_base&&) = delete; | ||
|
|
||
| virtual void __complete() noexcept = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I didn't get that far, yet.
| static consteval auto get_completion_signatures() // | ||
| -> __completion_signatures_of_t<__sched_sender_of_t<_Env>, _Env> { | ||
| return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed change breaks a test that requires that the join-sender have a scheduler in its receiver's environment. Keeping the deduced return type (which I expect to SFINAE away this function when appropriate) and adding the call to get_completion_signatures brings the test back to passing. Is that expected?
This diff adds a definition for `concept stdexec::scope_association` plus tests confirming it accepts and rejects the expected things.
This diff adds a definition for `concept stdexec::scope_token` plus tests confirming it accepts and rejects the expected things. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff defines `stdexec::associate` and adds some initial tests to confirm it works properly. Still a work in progress.
This diff defines `stdexec::__stop_when` as the implementation of _`stop-when`_ and adds tests to validate the algorithm. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff adds `stdexec::spawn` and its tests. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff adds `stdexec::simple_counting_scope` and `stdexec::counting_scope` plus tests for both. The tests found a spec bug that's been filed as an LWG issue. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
a0be249 to
0033e83
Compare
This diff adds `stdexec::spawn_future` and some basic tests. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff probably implements the intended design that stop requests sent to a started future-sender get forwarded to the spawned work. The existing tests still pass, but I don't have new tests to confirm the new behaviour. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
0033e83 to
735ef43
Compare
|
Ok, I think this is correct-ish on top of a very recent |
|
/ok to test aeed749 |
Wrap the call to `std::numeric_limits<std::size_t>::max` in parens so that Microsoft's `max` macro doesn't get in the way.
This PR will implement P3149R11 patched with P3815R1.
concept scope_associationconcept scope_tokenassociatealgorithmstop-whenalgorithmspawnalgorithmspawn_futurealgorithmsimple_counting_scopecounting_scope